import urllib.request

__url = 'http://www.baidu.com/s?wd='  # 搜索请求网址


def page(word):
    r = urllib.request.urlopen(__url + word)
    if r.getcode() == 200:  # 请求错误（不是200）处理
        return r.read().decode('gbk')
    else:
        print(r.getcode())
        return False

if __name__ == '__main__':
    word = input("please input words:")
    result = page(word)
    print(result)